Rotate camera with mouse? [closed]

Posted by ezio160324 on Game Development See other posts from Game Development or by ezio160324
Published on 2014-08-13T14:53:42Z Indexed on 2014/08/23 4:28 UTC
Read the original article Hit count: 157

Filed under:

Once again, using tutorial 10 at NeHe.

I want the code

if (keys[VK_RIGHT])                         // Is The Right Arrow Being Pressed?
{
    yrot -= 1.5f;                           // Rotate The Scene To The Left
}

if (keys[VK_LEFT])                          // Is The Left Arrow Being Pressed?
{
    yrot += 1.5f;                           // Rotate The Scene To The Right   
}

and

if (keys[VK_PRIOR])
 {
    lookupdown -= 1.0f;
 }

if (keys[VK_NEXT])
 {
    lookupdown += 1.0f;
 }

to be done with the mouse instead of left/right arrow and Page Up/ Page Down. I tried everything I could think of. Can anyone help?

EDIT: I tried using WM_MOUSEMOVE message. I just could not figure it out.

EDIT2: I am using pure OpenGL to do this. No window management system or other libs such as GLUT, GLFW, SDL, SFML etc. Just OpenGL. OpenGL and GLEW.

EDIT: Issue has been solved.

© Game Development or respective owner

Related posts about c++